se <- biocrates("2022-02-22_Conc_raw_smartcare 10 patient thorax cohort_hmdb.xlsx")
se$tissue <- ""
se$tissue[grep(x = se$Sample.Description, pattern = "_TU")] <- "TU"
se$tissue[grep(x = se$Sample.Description, pattern = "_NG")] <- "NG"
se$individual <- stringr::str_remove(se$Sample.Description, pattern = "_TU|_NG")Run the function metIDQ_get_high_quality_features and
only retain the features that have more than 2/3 of “green”/“lightblue”
values.
Exclude the following samples: PBS samples and
QC samples.
Perform log-transformation on the data set.
cD <- colData(se)
cD <- colData(se)
design <- model.matrix(~ 0 + tissue, data = cD)
colnames(design) <- make.names(colnames(design))
cor <- duplicateCorrelation(assay(se), design, block=cD$individual)
fit <- lmFit(object = assay(se), design = design, block = cD$individual,
correlation = cor$consensus)
## create contrasts
contrasts <- makeContrasts(
TUvsNG = ( tissueTU - tissueNG),
levels = design)
fit_c <- contrasts.fit(fit, contrasts)
fit_eB <- eBayes(fit_c)
## set parameters for differential expression
num <- Inf
p_val <- 1
adj <- "BH"We test here the DE proteins between NG and TU.
tT <- topTable(fit_eB, number = num, p.value = p_val, adjust.method = adj,
coef = "TUvsNG")
rmarkdown::paged_table(tT)## [1] 49
cD <- colData(se)
design <- model.matrix(~ 0 + tissue + individual, data = cD)
fit <- lmFit(object = assay(se), design = design)
## create contrasts
contrasts <- makeContrasts(
TUvsNG = (tissueTU - tissueNG),
levels = design)
fit_c <- contrasts.fit(fit, contrasts)
fit_eB <- eBayes(fit_c)
## set parameters for differential expression
num <- Inf
p_val <- 1
adj <- "BH"
## get the features for autoSP3
tT_covariate <- topTable(fit_eB, number = num, p.value = p_val,
adjust.method = adj, coef = "TUvsNG")
cor(x = tT_covariate$t[order(rownames(tT_covariate))], y = tT$t[order(rownames(tT))],
use = "pairwise.complete.obs")## [1] 0.9859315
European Molecular Biology Laboratory, Meyerhofstrasse 1, 69117 Heidelberg, Germany↩︎